/**
  ******************************************************************************
  * @file    timer.h
  * @author  Aizbot
  * @brief   xxx.
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; Copyright (c) 2023 Aizbot.
  * All rights reserved.</center></h2>
  *
  * http://www.aizbot.com
  *
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __TIMER_H
#define __TIMER_H

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "common.h"

/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
#ifdef TIMER_C
#define TIMER_EXT
#else
#define TIMER_EXT extern
#endif

/* Exported types ------------------------------------------------------------*/
/** 
  * @brief  xxx
  */  
typedef struct
{
	uint32_t current_time;
	uint32_t expired_time;
	uint8_t  free_flag;
}TIMER_t;

/* Exported variables --------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/
TIMER_EXT void Timer_Set(TIMER_t *timer, uint32_t nms);
TIMER_EXT void Timer_Free(TIMER_t *timer);
TIMER_EXT uint8_t Timer_Out(TIMER_t *timer);
TIMER_EXT void Timer_DelayMs(uint32_t nms);
TIMER_EXT void Timer_Test(void);

#ifdef __cplusplus
}
#endif

#endif /* __TIMER_H */

/************************ (C) COPYRIGHT Aizbot ********************************/
